package com.xixiake.immersive;

import android.content.Context;
import android.util.AttributeSet;
import android.view.View;

/**
 * Created by c-wanghengli on 2017/4/9.
 */
public class ImmersiveTitleBar extends View {

    int titleBarHeight;

    public ImmersiveTitleBar(Context context) {
        super(context);
        initUI(context);
    }

    public ImmersiveTitleBar(Context context, AttributeSet attrs) {
        super(context, attrs);
        initUI(context);
    }

    public ImmersiveTitleBar(Context context, AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
        initUI(context);
    }

    private void initUI(Context context) {
         titleBarHeight = ImmersiveUtil.getStatusBarHeight(context);
    }

    @Override
    protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
        super.onMeasure(widthMeasureSpec, MeasureSpec.makeMeasureSpec(titleBarHeight,MeasureSpec.EXACTLY));
    }
}
